<?#//v.3.1.1
#///////////////////////////////////////////////////////
#//  COPYRIGHT 2004 Phpauction.org ALL RIGHTS RESERVED//
#///////////////////////////////////////////////////////

require('../includes/config.inc.php');
include "loggedin.inc.php";

#//
if($_POST[action] == "insert" && phpa_securepost($_POST))
{
	if(empty($_POST[name]) || empty($_POST[company]) || empty($_POST[email]))
	{
		$ERR = $ERR_047;
	}
	elseif(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+([\.][a-z0-9-]+)+$",$_POST[email]))
	{
		$ERR = $ERR_008;
	}
	else
	{
		#// Update database
		$query = "INSERT INTO PHPAUCTIONXL_bannersusers
					  VALUES (
					  NULL,
					  '".addslashes($_POST[name])."',
					  '".addslashes($_POST[company])."',
					  '$_POST[email]')";
		$res = @mysql_query($query);
		if(!$res)
		{
			print "Error: $query<BR>".mysql_error();
			exit;
		}
		else
		{
			$ID = mysql_insert_id();
			Header("Location: userbanners.php?id=$ID");
			exit;
		}
	}
}


?>
<HTML>
<HEAD>
<link rel='stylesheet' type='text/css' href='style.css' />
<link href="css/main.css" rel="stylesheet" type="text/css">
</HEAD>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0" class="titulo">
        <tr> 
          <td class="icono"><img src="images/ad_icon2.gif" width="22" height="22" ></td>
          <td class="breadcrumbs"><p><span><?=$MSG_25_0011?></span>&nbsp;&gt;&gt;&nbsp;<?=$MSG__0008?></p></td>
        </tr>
      </table></td>
  </tr>
    <tr> 
    <td align="center" valign="middle">
	<BR>
	<FORM NAME=conf ACTION=<?=basename($_SERVER['PHP_SELF'])?> METHOD=POST>
		<TABLE WIDTH="95%" BORDER="0" CELLSPACING="0" CELLPADDING="0"  class="base" style="border:1px solid #ccc;">
			<TR>
				<TD ALIGN=CENTER>
					<p><? print $MSG__0026; ?></p>
					</TD>
			</TR>
			<TR>
				<TD>

                <TABLE WIDTH=100% ALIGN="CENTER" CELLPADDING=0 cellspacing="0" BGCOLOR="#FFFFFF">
                  <?
                  if(!empty($ERR))
                  {
						?>
                  <TR>
                    <TD COLSPAN="2" class="error"> <B>
                      <p><?=$ERR?></p>
                       </B></TD>
                  </TR>
                  <?
                  }
						?>
                  <TR VALIGN="TOP">
                    <TD COLSPAN="2">
                      <p><A HREF=managebanners.php><?=$MSG__0027?></A></p>
                    </TD>
                  </TR>
                  <TR VALIGN="TOP">
                    <TD WIDTH="125" HEIGHT="22" class="gris">
                      <p class="blue"><?=$MSG_302?></p>
                    </TD>
                    <TD HEIGHT="22" WIDTH="531" class="gris">
                      <INPUT TYPE=text NAME=name SIZE=40 VALUE=<?=$_POST[name]?>>
                    </TD>
                  </TR>
                  <TR VALIGN="TOP">
                    <TD WIDTH="125" HEIGHT="22">
                      <p class="blue"> <?=$MSG__0022?></p>
                    </TD>
                    <TD HEIGHT="22" WIDTH="531">
                      <INPUT TYPE=text NAME=company SIZE=40 VALUE=<?=$_POST[company]?>>
                    </TD>
                  </TR>
                  <TR VALIGN="TOP">
                    <TD WIDTH="125" HEIGHT="22" class="gris">
                     <p class="blue"> <?=$MSG_107?></p>
                    </TD>
                    <TD HEIGHT="22" WIDTH="531" class="gris">
                      <INPUT TYPE=text NAME=email SIZE=40 VALUE=<?=$_POST[email]?>>
                    </TD>
                  </TR>
                  <TR>
                    <TD WIDTH="125">&nbsp; </TD>
                    <TD WIDTH="531">
                      <INPUT TYPE="hidden" NAME="action" VALUE="insert">
					  <INPUT TYPE="hidden" NAME="security" VALUE="<?php echo $_SESSION['security'];?>" />
                      <INPUT TYPE="submit" NAME="submit" VALUE="<?=$MSG_569?>" class="action">
                    </TD>
                  </TR>
                  <TR>
                    <TD COLSPAN="2"> </TD>
                  </TR>
                </TABLE>
				</TD>
			</TR>
		</TABLE>
		</FORM>
	<BR>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>